/* For Z-Blog erx_VIP [ https://app.zblogcn.com/?id=42368 ] */ $(function(){ var erxVIPStyle = ` `; var erxVIPDom = `

先登录账号

填写有效会员码,一键升级续期

相同目标等级有效期可叠加,有效期过后自动恢复到原始等级

点击这里获取会员码

会员升级·续期

×
`; $("head").append(erxVIPStyle); $("body").append(erxVIPDom); $(".erx-vip-inner .e-close").click(function(){ $(".erx-vip-wrap").removeClass("erxshow").children().removeClass("erxact"); $(this).hasClass("e-succeed") ? location.reload() : ''; }); $("body").on("click", "a[href='#vipmember']", function() { $(".erx-vip-wrap").addClass("erxshow").find(".e-code").focus(); setTimeout(function(){ $(".erx-vip-inner").addClass("erxact"); }, 50); return false; }); $(".erx-vip-form button").click(function(){ let $self = $(this), btn_t = $self.text(), $code = $(".erx-vip-form .e-code"), code = $code.val(), token = $(".erx-vip-form .e-token").val(); if($self.hasClass("erxact")){ return; } if(code.length != 18){ erxVIPtips("\u4f1a\u5458\u7801\u586b\u5199\u9519\u8bef\uff01", "red"); $code.focus().addClass("erxerr"); setTimeout(function(){ $code.removeClass("erxerr"); }, 1500); return; } $self.addClass("erxact").text("\u6b63\u5728\u5904\u7406\u2026\u2026"); $.post(bloghost + "zb_users/plugin/erx_VIP/" + "post" + "." + "php", { "code":code, "token":token, }, function(data){ let s = data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)){ erxVIPtips(s.match(".+?")[0].replace("","").replace("",""), "red"); }else{ $.ajax({ type: "GET", timeout: 5000, url: bloghost + "zb_users/plugin/erx_VIP/extra/" + "do" + "." + "php?act=getval", success: function(data){ if(data != ''){ let uds = data.split("===erx==="); $(".erx-vip-form .levelname").text(uds[0]).parent().next().addClass("erxshow").find(".days").text(uds[1]).animate({opacity:0.1},300).animate({opacity:1},300).animate({opacity:0.1},300).animate({opacity:1},300).animate({opacity:0.1},300).animate({opacity:1},300).parent().next().removeClass("erxshow"); $self.parent().next().addClass("e-succeed").attr("title", "\u5173\u95ed\u5e76\u5237\u65b0\u7f51\u9875"); erxVIPtips(s, ""); $code.val(''); } } }); } $self.removeClass("erxact").text(btn_t); } ); }); function erxVIPtips(txt, cn){ let $tips = $(".erx-vip-form .e-i-tips"); $tips.text(txt).addClass(cn); setTimeout(function(){ $tips.text("").removeClass("red"); }, 3000); } document.addEventListener("keydown", function(e){ let $code = $(".erx-vip-form .e-code"), code = $code.val(); if(e.keyCode == 13 && $code.focus() && code.length){ $(".erx-vip-form button").trigger("click"); } }); });